﻿using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace SimulationCenter.Tasks
{
    /// <summary>
    /// 总任务
    /// </summary>
    [Table("ScTask")]
    public class ScTask
    {
        /// <summary>
        /// 编号
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 任务名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 任务描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 任务状态
        /// </summary>
        public ScTaskStatus Status { get; set; }

        /// <summary>
        /// 公众号范围
        /// </summary>
        public ScSubscriptionRange SubscriptionRange { get; set; }

        /// <summary>
        /// 关联公众号
        /// </summary>
        public string TargetSubscriptions { get; set; }

        ///// <summary>
        ///// 设备范围
        ///// </summary>
        //public ScDeviceRange DeviceRange { get; set; }

        /// <summary>
        /// 关联设备
        /// 多个设备以逗号(,)分割
        /// </summary>
        public string TargetDevices { get; set; }

        /// <summary>
        /// 消息检索范围
        /// </summary>
        public ScMsgRange MsgRange { get; set; }

        /// <summary>
        /// 消息检索范围
        /// 最后 ？ 天内的消息
        /// </summary>
        public int? LastDays { get; set; }

        /// <summary>
        /// 任务循环方式
        /// </summary>
        public ScLoopMode LoopMode { get; set; }

        /// <summary>
        /// Cron 
        /// </summary>
        public string Cron { get; set; }

        /// <summary>
        /// 启动时间
        /// </summary>
        public DateTime? StartAt { get; set; }
        
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndAt { get; set; }
    }
}
